package com.norma.macaron.service.common.repository.user;

import com.norma.macaron.service.common.domain.user.TUserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserRoleRepository extends JpaRepository<TUserRole,String>, JpaSpecificationExecutor<TUserRole> {

    @Query("select userrole from TUserRole userrole where userrole.userId=:userId")
    List<TUserRole> getByUserId(@Param("userId") String userId);

}
